package com.lizemin.builderfactorycase.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author lzm
 * @date 2025/10/19 22:08
 * @description
 */
@RestController
public class FactoryBeanController {

    @Autowired
    private DateTimeFormatter dateTimeFormatter;

    @GetMapping("/now")
    public String now() {
        LocalDateTime now = LocalDateTime.now();
        return dateTimeFormatter.format(now);
    }

}
